<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator" %>  
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <!-- BootStrap不支持IE的兼容模式,下面代码为了代码在IE下运行最新的渲染模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 在移动设备浏览器上，通过为视口（viewport）设置 meta 属性为 user-scalable=no 可以禁用其缩放（zooming）功能。 -->
    <!-- 这样禁用缩放功能后，用户只能滚动屏幕，就能让你的网站看上去更像原生应用的感觉。 -->
    <!-- width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no -->
    <!-- 初始化移动设备的浏览 width=device-width 视口的宽度等于设备宽度，initial-scale=1 缩放比例为1 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>极简::<sitemesh:title/></title>

    <!-- 加载图标 -->
    <link type="image/x-icon" href="${ctx}/static/images/logo/favicon.ico" rel="shortcut icon">
    <!-- 加载Bootstrap css 样式 -->
    <link href="${ctx}/static/bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">
  
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- 使IE8支持HTML5标签 -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="${ctx}/static/support/html5shiv.min.js"></script>
      <script src="${ctx}/static/respond.min.js"></script>
    <![endif]-->
    
    <sitemesh:head/>
  </head>

  <body>
    <!-- 头部导航条 -->
    <%@ include file="/WEB-INF/layouts/header.jsp"%>
	<sitemesh:body/>

	<script type="text/javascript">
	<!-- 修改用户密码! -->
	function updatePassword(){
		$("#updatePassword .modal-body >.alert").remove();
		jQuery.ajax({
			url: "${ctx}/user/updatePassword",
			data:{"oldPassword":$("#oldPassword").val(),"newPassword":$("#newPassword").val(),"confirmPassword":$("#confirmPassword").val()},
			type: "post",
			dataType: "json",
			success: function(msg) {
				var alertStr='';
				if(msg.status){
					alertStr=alertStr+'<div class="alert alert-success alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>';
					alertStr=alertStr+msg.message;
					alertStr=alertStr+'</div>';
				}else{
					alertStr=alertStr+'<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>';
					alertStr=alertStr+msg.message;
					alertStr=alertStr+'</div>';
				}

				$("#updatePassword .modal-body").prepend(alertStr);

			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
	             alert(XMLHttpRequest.status);
	             alert(XMLHttpRequest.readyState);
	             alert(textStatus);
	         }
		});

	}
	</script>

  </body>
</html>